package com.hongfeng.support.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.hongfeng.support.model.common.BaseEntity;

/**
 * 
 * <用户类>
 *
 * @author llc
 * @date 创建时间：2012-12-5 下午04:39:39
 */
@Entity
@Table(name = "sys_user")
public class User extends BaseEntity {

	private static final long serialVersionUID = 3552653191054309043L;

	@Id
	@GeneratedValue
	@Column(name = "id")
	private Long id;
	// 用户名
	@Column(name = "username", length = 20, nullable = false)
	private String username;
	// 密码
	@Column(name = "password", length = 50, nullable = false)
	private String password;
	// 姓名
	@Column(name = "realname", length = 20)
	private String realname;
	// 联系电话
	@Column(name = "telphone", length = 20)
	private String telphone;
	// 地址
	@Column(name = "address", length = 200)
	private String address;
	// 是否有效
	@Column(name = "is_enable")
	private Short isEnable;
	// 备注
	@Column(name = "memo", length = 200)
	private String memo;
	// 角色（多对一）
	@ManyToOne
	@JoinColumn(name = "role_id")
	private Role role;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public String getAddress() {
		return address;
	}

	public Short getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(Short isEnable) {
		this.isEnable = isEnable;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}
}
